﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HiddenFileManager
{
    public static class ExtensionMethods
    {
        public static bool Matches(this ListViewItem item, string pattern)
        {
            pattern = pattern.ToUpper();
            if (item.Text.ToUpper().Contains(pattern)) { return true; }

            foreach (ListViewItem.ListViewSubItem si in item.SubItems)
            {
                if (si.Text.ToUpper().Contains(pattern)) { return true; }
            }
            return false;
        }
    }
}
